using System.Collections;
using Wilco.SyntaxHighlighting.Engine.Node.Implementation.CommentBlock;

namespace Wilco.SyntaxHighlighting.Engine.Node.Implementation
{
    /// <summary>
    /// Represents a collection of entities.
    /// </summary>
    public class EntityCollection : CollectionBase
    {
        /// <summary>
        /// Initializes a new instance of a <see cref="EntityCollection"/> class.
        /// </summary>
        public EntityCollection()
        {
        }

        /// <summary>
        /// Gets an <see cref="Entity"/> object at the specified index.
        /// </summary>
        public Entity this[int index]
        {
            get
            {
                return (Entity)List[index];
            }
        }

        /// <summary>
        /// Adds an entity.
        /// </summary>
        /// <param name="entity">An <see cref="Entity"/> object.</param>
        /// <returns>Index of the added object.</returns>
        public int Add(Entity entity)
        {
            return List.Add(entity);
        }

        /// <summary>
        /// Removes a entity.
        /// </summary>
        /// <param name="entity">An <see cref="Entity"/> object.</param>
        public void Remove(Entity entity)
        {
            List.Remove(entity);
        }
    }
}